/*  1:   */ package com.atomikos.icatch.jta;
/*  2:   */ 
/*  3:   */ import com.atomikos.icatch.TxState;
/*  4:   */ import com.atomikos.icatch.system.Configuration;
/*  5:   */ 
/*  6:   */ class Sync2Sync
/*  7:   */   implements com.atomikos.icatch.Synchronization
/*  8:   */ {
/*  9:   */   protected javax.transaction.Synchronization sync_;
/* 10:   */   private Boolean committed_;
/* 11:   */   
/* 12:   */   Sync2Sync(javax.transaction.Synchronization sync)
/* 13:   */   {
/* 14:49 */     this.sync_ = sync;
/* 15:   */   }
/* 16:   */   
/* 17:   */   public void beforeCompletion()
/* 18:   */   {
/* 19:55 */     this.sync_.beforeCompletion();
/* 20:   */     
/* 21:57 */     this.committed_ = null;
/* 22:   */   }
/* 23:   */   
/* 24:   */   public void afterCompletion(Object state)
/* 25:   */   {
/* 26:62 */     if (state.equals(TxState.TERMINATED))
/* 27:   */     {
/* 28:63 */       if (this.committed_ == null)
/* 29:   */       {
/* 30:66 */         this.sync_.afterCompletion(5);
/* 31:67 */         Configuration.logInfo("afterCompletion ( STATUS_UNKNOWN ) called  on Synchronization: " + this.sync_.toString());
/* 32:   */       }
/* 33:   */       else
/* 34:   */       {
/* 35:71 */         boolean commit = this.committed_.booleanValue();
/* 36:72 */         if (commit)
/* 37:   */         {
/* 38:73 */           this.sync_.afterCompletion(3);
/* 39:74 */           Configuration.logInfo("afterCompletion ( STATUS_COMMITTED ) called  on Synchronization: " + this.sync_.toString());
/* 40:   */         }
/* 41:   */         else
/* 42:   */         {
/* 43:79 */           this.sync_.afterCompletion(4);
/* 44:80 */           Configuration.logInfo("afterCompletion ( STATUS_ROLLEDBACK ) called  on Synchronization: " + this.sync_.toString());
/* 45:   */         }
/* 46:   */       }
/* 47:   */     }
/* 48:86 */     else if (state.equals(TxState.COMMITTING)) {
/* 49:87 */       this.committed_ = new Boolean(true);
/* 50:88 */     } else if (state.equals(TxState.ABORTING)) {
/* 51:89 */       this.committed_ = new Boolean(false);
/* 52:   */     }
/* 53:   */   }
/* 54:   */ }


/* Location:           C:\myfile\mysoft\apache-maven-3.5.0-bin\apache-maven-3.5.0\myrep\com\atomikos\transactions-jta\3.7.0\transactions-jta-3.7.0.jar
 * Qualified Name:     com.atomikos.icatch.jta.Sync2Sync
 * JD-Core Version:    0.7.0.1
 */